# coding:utf-8
# @Time    : 2021/12/2 10:13
# @Author  : Martin

from selenium.webdriver.chrome.options import Options
from selenium import webdriver

# from page_object.base_page import BasePage
# from page_object.offline_order_gift_page import OrderGiftPage
# from page_object.query_page import QueryPage
# from page_object.welcome_page import WelcomePage
from util.logger import Logger

if __name__ == '__main__':
    # do = Demo()
    # getattr(do, "demo_test")()
    # getattr(do, "demo_test2")('martin')
    # limit=',1'
    # max_limit, min_limit = limit.split(',')
    # print(max_limit==' ')

    chrome_options = Options()
    chrome_options.add_experimental_option("debuggerAddress", "localhost:9222")

    # chrome_options.add_experimental_option('excludeSwitches',
    #                                        ['enable-automation', 'enable-logging', 'load-extension'])
    # 去掉账号密码弹窗
    # prefs = {}
    # prefs["credentials_enable_service"] = False
    # prefs['profile.password_manager_enable'] = False
    # chrome_options.add_experimental_option("prefs", prefs)
    driver = webdriver.Chrome(options=chrome_options)
    # driver.maximize_window()
    logger = Logger.get_logger()
    # bp = BasePage(driver,logger)
    # qp = QueryPage(driver, logger)
    # qp.query_act('22000NSP10808835')
    # dt = qp.go_to_detail('22000NSP10808835')
    # dt.wait('3')
    # bp = DetailPage(driver, logger)
    # dt.click_res_detail()
    # dt.screen_shot()
    # print(dt.get_resource_amount(**{'company': '1001', 'store': '70AB'}))
    # print(bp._business_code)
    # wc = WelcomePage(driver, logger)
    # print(wc._business_code)
    # bp = LoginPage(driver, logger)
    # bp.log_in('14100131')
    # p1_cases_name, p1_cases_step = get_test_data('debug.yaml', 'P1')
    # bp.do_success(p1_cases_step[0][0])
    # pa = OnlineFloorGiftPage(driver, logger)
    # pa.scroll_bottom()

    print('end')
